<?php
/**
 * Created by litong on Date: 2019/2/25 0025 下午 4:56
 */
$id = intval($_REQUEST['id']);
$firstname = $_REQUEST['firstname'];
$lastname = $_REQUEST['lastname'];
$phone = $_REQUEST['phone'];
$email = $_REQUEST['email'];

$sql = "update users set firstname='$firstname',lastname='$lastname',phone='$phone',email='$email' where id=$id";

include 'conn.php';
$connection = getConnection();
$result = mysqli_query($connection,$sql);
if ($result){
  echo json_encode(array('success'=>true));
} else {
  echo json_encode(array('msg'=>$result));
}